<?php
    class Article{
        
        private $template;
        
        public function getPage(array $args){
            
            // arguments array bigger than 1
           if(count($args) > 0){
               if($args['template'] == 'article'){
                   $this->template = $args['template'];
                   //print $args['template'];
                   // gets page content as object
                   $page = new MPage($args);
                   //$page->getPageData();
                   
                   $article = new MArticle($args['template']);
                   $data = $page->getPageData();
                   //print_r($data);
                   if(array_key_exists('src', $args)){
                       $s = new LSourceFiles($args['src'], $data);
                       $article->setData($data, $s->getSourceFiles());
                       $article->output(true);
                   }else{
                       $article->setData($data);
                       $article->output(true);
                   }
                   
               }
               else{
                   // code
               }
           }
           else{
               // if no arguments set default template article
               $this->template = 'article';
           }
           
           
            
        }
        
        
        
    }
?>